<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en" class="no-js">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册页面</title>
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/supersized.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
	<div class="page-container">
		<h1>注册</h1>
		<form action="UserServlet?action=register" method="post">
			<input type="text" name="username" class="username"
				placeholder="请输入用户名" id="name" onblur="uname();"><br>
			<br>
			<span id="unamespan"></span> <input type="password" name="passwords"
				class="password" placeholder="请输入密码" id="pwd" onblur="upwd();"><br>
			<br> <span id="upwdspans"></span> <input type="password"
				name="password" class="password" placeholder="请确认密码" id="pwds"
				onblur="upwds();"><br> <br> <span id="upwdspan"></span>
			<button type="submit">提交</button>
			<button onclick="back()">返回</button>
			<div class="error">
				<span>+</span>
			</div>
		</form>
		<div class="connect">
			<p>Or connect with:</p>
			<p>
				<a class="facebook" href=""></a> <a class="twitter" href=""></a>
			</p>
		</div>
	</div>
	<!-- Javascript -->
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/supersized.3.2.7.min.js"></script>
	<script type="text/javascript" src="js/supersized-init.js"></script>
	<script type="text/javascript" src="js/scripts.js"></script>
	<script>
		function uname() {
			var name = $("#name").val();
			$.get("Userlogin", "n=" + name, function(abc) {
				$("#unamespan").html(abc);
			});
		}
		function upwd() {
			uname();
			var pwd = $("#pwd").val();
			if (pwd == "") {
				$("#upwdspans").html("密码不能为空");
			} else {
				$("#upwdspans").html("");
			}

		}
		function upwds() {
			upwd();
			var pwd = $("#pwd").val();
			var pwds = $("#pwds").val();
			if (pwd != pwds) {
				$("#upwdspan").html("俩次输入密码不一致 请重新输入");
			} else {
				$("#upwdspan").html("");
			}
		}
		function back() {
			history.back();
		}
	</script>
</body>
</html>